const { setEvent } = require("../../utils/index")

// plugin/components/airinfo/index.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    airLineName: {
      type: String, 
      value: ''
    },
    date: {
      type: String,
      value: ''
    },
    time: {
      type: String,
      value: ''
    },
    flightNumber: {
      type: String,
      value: ''
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    isTipOpen: true
  },

  /**
   * 组件的方法列表
   */
  methods: {
    selectAirLine: function() {
      this.triggerEvent('line')
    },
    onToggleAirTips: function() {
      const isTipOpen = this.data.isTipOpen
      this.setData({
        isTipOpen: !isTipOpen
      })
      
      setEvent('订单填写页', 'DD39', '')
    },

    selectDate: function(e) {
      const date = e.detail.value
      this.triggerEvent('datachange', date)
    },
    selectTime: function(e) {
      const time = e.detail.value
      this.triggerEvent('timechange', time)
    },

    flightNameInput: function(e) {
      const name = e.detail.value
      this.triggerEvent('numberchange', name)

    }
  }
})
